#ifndef _objectMgr_h_
#define _objectMgr_h_

// objectMgr.h
//
// Objectging template object

//Disable the warning regarding long template names
#ifdef WIN32
#pragma warning(disable:4786)
#pragma warning(disable:4503)
#endif

#include "debugging.h"

#include <map>
#include <string>


namespace simple{
    
    //
    // ObjectMgr
    //
    class ObjectInfoBase; // Forward declaration


    class ObjectMgr
    {
     public:
        typedef std::map<std::string, ObjectInfoBase*> OBJMAP;

        static ObjectMgr& gOnly ();
        //singleton object

        std::string dump ();
        // Text dump of all objects in use

        void debugMessage (const std::string& header,
                           const std::string& msg);
        // Generate a debug message to cdebug

        void add (const std::string& name, ObjectInfoBase* obj);
        // Add an object to our list

        ObjectInfoBase* find (const std::string& name);
        // Returns a pointer to a specific ObjectInfoBase, or 0

        std::string process (const std::string& command);
        // Send the command to all object instances

    private:
        static ObjectMgr* _sOnly;
        ObjectMgr ();

        OBJMAP _mapping;    // List of all managed classes
    };

}
#endif // _objectMgr_h_
